<template>
  <div class="content-container">
    <div class="menu-panel" style="position: relative">
      <img class="system-logo-icon" src="@/assets/logo.png"></img>
      <div style="display: flex">
          <div style="width: 300px;display: flex;margin-left: 220px">
            <div class="key-menu" style="background-color: rgba(244,131,121,1);" @click="$router.push('/position-query')">
              <img class="icon" src="@/assets/icon-gwxc.png"/>
              <div class="title">岗位查询</div>
            </div>
          </div>
          <div style="display: flex; flex-direction: column">
            <div class="row">
              <div class="menu" style="background-color: rgba(35,192,161,1);" @click="$router.push('/employ')">
                <img class="icon"  src="@/assets/icon-qz.png"/>
                <div class="title">求职登记</div>
              </div>
              <div class="menu" style="background-color: rgba(252,192,0,1);" @click="$router.push('/labor-rights')">
                <img class="icon" src="@/assets/icon-ldwq.png" />
                <div class="title">劳动维权</div>
              </div>

            </div>
            <div class="row" style="margin-top: 20px">
              <div class="menu" style="background-color: rgba(67,165,240,1);" @click="$router.push('/skills-training')">
                <img class="icon" src="@/assets/icon-px.png"/>
                <div class="title">技能培训</div>
              </div>
              <div class="menu" style="background-color: rgba(39,169,185,1);" @click="$router.push('/policy')" >
                <img class="icon" src="@/assets/icon-zc.png"/>
                <div class="title">政策咨询</div>
              </div>
            </div>
          </div>
          <div style="display: flex; flex-direction: column">
            <div class="row">
              <div class="menu" style="background-color: rgba(67,165,240,1);" @click="$router.push('/qa-robot')">
                <img class="icon" src="@/assets/icon-qa.png"/>
                <div class="title">智能问答</div>
              </div>
              <div class="menu" style="background-color: rgba(39,169,185,1);" @click="$router.push('/window-direct')">
                <img class="icon"  src="@/assets/icon-custom.png"/>
                <div class="title">窗口直达</div>
              </div>
            </div>
            <div class="row" style="margin-top: 20px">
              <div class="menu" style="background-color: rgba(67,165,240,1);" @click="handleJobRegister">
                <img class="icon" src="@/assets/icon-law.png"/>
                <div class="title">就业服务</div>
              </div>
              <div class="menu" style="background-color: rgba(39,169,185,1);" @click="$router.push('/equity-maintain')">
                <img class="icon"  src="@/assets/icon-qywh.png"/>
                <div class="title">权益维护</div>
              </div>
            </div>
          </div>
        </div>
      <div class="tools">
        <div class="login-btn" v-show="!login" @click="$router.push({path:'/login'})">登 录</div>

      </div>
      </div>
    <job-register ref="jobRegister" :dialog-visible="jobRegisterDialogVisible" @handleClose="handleClose" />

  </div>
</template>

<script>
import {getUser} from "@/utils/auth";
import JobRegister from '@/views/job/register.vue'

export default {
  name:"home-page",
  components: {
    JobRegister
  },
  data(){
    return {
      userInfo:null,
      login:false,
      jobRegisterDialogVisible: false
    }
  },
  mounted() {
    const yzxh = sessionStorage.getItem("yzxh")
    if (!yzxh){
      sessionStorage.setItem("yzxh",this.$route.query.yzxh)
    }
    this.userInfo = getUser()
    if (this.userInfo){
      this.login = true
    } else {
      this.login = false
    }
  },
  methods: {

    jumpTo(url){
      this.$router.push(url)
    },
    vedioChat(){
      window.android.startVedioChat()
    },
    handleJobRegister() {
      this.jobRegisterDialogVisible = true
      this.$refs.jobRegister.$nextTick(() => {
        this.$refs.jobRegister.handleInit()
      })
    },
    handleClose() {
      this.jobRegisterDialogVisible = false
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.menu-panel{
  width: 100%;
  margin-top: 100px;
  .bg{
    width: 400px;
    z-index: -1;
    left: 10px;
    top: 150px;
    position: absolute;
  }
  //height: calc(100vh - 80px);
  .row{
      width: 100%;
      display: flex;
      .menu{
        box-shadow: 4px 4px 4px 0 rgba(0, 0, 0, 0.5);
        cursor: pointer;
        margin-left: 20px;
        width: 300px;
        height: 300px;
        border-radius: 16px;
        .icon{
          margin-top: 60px;
          width: 100px;
          height: 100px;
        }
        .title{
          margin-top: 11.5px;
          font-size: 30px;
          color: white;
        }
      }
    }

  .key-menu{
    box-shadow: 4px 4px 4px 0 rgba(0, 0, 0, 0.5);
    cursor: pointer;
    margin-left: 10px;
    width: 400px;
    height: 620px;
    border-radius: 16px;
    .icon{
      margin-top: 120px;
      width: 200px;
      height: 200px;
    }
    .title{
      margin-top: 70px;
      font-size: 36px;
      color: white;
    }


  }

}
.tools{
   text-align: center;
  .login-btn{
    cursor: pointer;
    margin: 50px auto 0px auto;
    width: 407px;
    height: 83px;
    line-height: 83px;
    border-radius: 13px;
    background-color: rgba(64,149,229,0.8);
    color: rgba(255,255,255,1);
    font-size: 36px;
    text-align: center;
    font-family: Roboto;
    border: 1px solid white;
  }
}
</style>
